import http from '@/service/http'
import type * as T from '@/types/api/index'
import { decrypt, encrypt } from '@/utils/aes'
const ExchangeApi: T.IAblumList = {
  async list(data) {
    const res: any = await http.post('/admin/Exchange/list', data)
    res.data = JSON.parse(decrypt(res.data))
    return res
  },
  add(data) {
    data.title = encrypt(data.title)
    data.content = encrypt(data.content)
    data.url = encrypt(data.url)
    return http.post('/admin/Exchange/add', data)
  },
  edit(data) {
    data.title = encrypt(data.title)
    data.content = encrypt(data.content)
    data.url = encrypt(data.url)
    return http.post('/admin/Exchange/edit', data)
  },
  dels(data) {
    return http.post('/admin/Exchange/dels', data)
  }
}

export default ExchangeApi
